import axios from 'axios';

export function fanOpen() {

   var host = window.location.hostname;
//var host = "localhost";
   var config = {
      method: 'get',
      url: 'http://'+host+':8080/mqtt/fanopen',
      headers: { }
   };

   axios(config)
   .then(function (response) {
      console.log(JSON.stringify(response.data));
   })
   .catch(function (error) {
      console.log(error);
   });
}

export function fanClose() {

    var host = window.location.hostname;
    
   var config = {
      method: 'get',
      url: 'http://'+host+':8080/mqtt/fanclose',
      headers: { }
   };

   axios(config)
   .then(function (response) {
      console.log(JSON.stringify(response.data));
   })
   .catch(function (error) {
      console.log(error);
   });
}

